#include<iostream>
using namespace std;
int main()
{int n,k,a[100];
 cin>>n;
 for(int i=1;i<=n;i++)
 {cin>>k;
  int sum=0;
  for(int j=1;j<=k;j++)
    {cin>>a[j];
     sum+=a[j];
     }
  cout<<sum-k+1<<endl;
}
system("pause");
return 0;
}
  
